Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linux machine got log off, if used raise command for Bwidget TAB

Status
Not open for further replies.

vsdpsingh

Programmer
Mar 8, 2011
32
0
0
IN
Hi,
I am using Bwidget code for Tab in my application.
These tab also has close tab button also.
When user close tab, then current tab is destroyed and net tab is raised.

When i am raising tab, the machine is getting logged off!

If i use the same in the machine having graphics card, then it works perfectly fine.

Xorg.conf settings are that i am using in my machine (without graphics card):

###############################################################
# Xorg configuration created by system-config-display

Section "ServerLayout"
Identifier "single head configuration"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "Monitor"

### Comment all HorizSync and VertSync values to use DDC:
### Comment all HorizSync and VertSync values to use DDC:
### Comment all HorizSync and VertSync values to use DDC:
### Comment all HorizSync and VertSync values to use DDC:
### Comment all HorizSync and VertSync values to use DDC:
Identifier "Monitor0"
ModelName "LCD Panel 1024x768"
### Comment all HorizSync and VertSync values to use DDC:
HorizSync 31.5 - 48.0
VertRefresh 56.0 - 65.0
Option "dpms"
EndSection

Section "Device"
Identifier "Videocard0"
Driver "intel"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
###############################################################3


Thanks in advance. Please Help!
 
I'd guess there is a problem with the Tk installation. Bwidgets is all written in Tcl (as far as I can tell). Have you had any other issues with widgets?

One thing you could try is to overwrite the binding for the tab
Code:
# ---------------------------------------------------------------------------
#  Command NoteBook::bindtabs
# ---------------------------------------------------------------------------
proc NoteBook::bindtabs { path event script } {
    if { $script != "" } {
	append script " \[NoteBook::_get_page_name [list $path] current 2\]"
        $path.c bind "page" $event $script
    } else {
        $path.c bind "page" $event {}
    }
}
and/or the raise function
Code:
# ---------------------------------------------------------------------------
#  Command NoteBook::raise
# ---------------------------------------------------------------------------
proc NoteBook::raise { path {page ""} } {
    variable $path
    upvar 0  $path data

    if { $page != "" } {
        _test_page $path $page
        _select $path $page
    }
    return $data(select)
}


_________________
Bob Rashkin
 
Hi,
i am very sorry for replying you late.
Very thanks for you reply. I tried changing the code, but could not help.

Apart from Close Tab, i am NOT facing any issues regarding BWidget

I traced back the whole issue. And finally got stuck to the one line.

STEP 1. I was tracing back for closing and raising tab procedure
STEP 2. where i found "_select $path $page" procedure calling.
STEP 3. In the end of _select procedure, I found "_draw_area $path" procedure calling.
STEP 4. In _draw_area procedure... we are doing coords of whole canvas at the end of the procedure... ...
if { $sel != "" } {
# Sven
if { [llength [$path.c find withtag "window"]] == 0 } {
$path.c create window 2 [expr {$y0+1}] -width [expr {$w-3}] -height [expr {$yo-3}] -anchor nw -tags "window" -window $path.f$sel
}
$path.c coords "window" 2 [expr {$y0+1}]
$path.c itemconfigure "window" -width [expr {$w-3}] -height [expr {$yo-3}] -window $path.f$sel
# Sven end
} else {
$path.c delete "window"
}

coords of whole window is causing log off of machine, i guess.

If i hash these lines. EVERY THING WILL WORK PERFECTLY (But tab window will be here and there as we did not do the coords)

Till here i guess, issue i traced back is right.
Please guide me more and provide me some alternative.

Thanks in advance
 
NO.. i traced back more in same procedure of "_draw_area" ....

$path.c itemconfigure "window" -width [expr {$w-3}] -height [expr {$yo-3}] -window $path.f$sel

Here BWidget code is configuring the canvas width and height....

These are the main culprit lines which are causing the Log-Off of the machine.

Can you please suggest me any alternative to these lines??

Thanks in advance
 
The only thing I can think of is that one or more of the variables, $w, $yo, or $sel (probably not $sel) if you're sure you're getting to the "itemconfigure" isn't set or isn't available in the scope of the "if" block.

You can test this by using actual values at least temporarily.

_________________
Bob Rashkin
 
Nope. It did not helped me. I tried giving hard coded values,
like

$path.c coords "window" 2 22
$path.c itemconfigure window -width 1318 -height 585 -window $path.f$sel

but results are same. :(
 
I dont know its very weird friend.
I could not trace back the real sequence.


From NoteBook::_select proc --> _draw_page proc till _draw_area proc, machine is getting log off randomly.

Last time when i was working, it got log off on _draw_area proc thrice, but now i figured out it can be on any line, depending on the load of computer.

NoteBook::_select is called from NoteBook::raise, after that, machine may log off at any line in NoteBook::_select [sad]

I am feeling helpless to explain the situation,

Can we look it in other way like graphics and all??

Xorg.conf settings for machine are :

(In this we added "Load glx", but this is also not helping)

# Xorg configuration created by pyxf86config

Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "Device"
Identifier "Videocard0"
Driver "intel"
EndSection

Section "Module"
# Double Buffer extension
Load "dbe"
# Loading the fonts
Load "extmod"
Load "type1"
Load "freetype"
# glx implementing OpenGL
Load "glx"
EndSection

Section "DRI"
Mode 0666
EndSection

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection

 
I'm stumped and I don't have a platform to test anything on (I use Python on my Linux PCs at home so I only test Tcl stuff at work).

_________________
Bob Rashkin
 
Thanks for your help! [smile]

I will try some more hit and trial. Thanks for your patience and Concern.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top