Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 01 Sep 2014, 04:39
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GtkDialog - tips
Post new topic   Reply to topic View previous topic :: View next topic
Page 52 of 64 [949 Posts]   Goto page: Previous 1, 2, 3, ..., 50, 51, 52, 53, 54, ..., 62, 63, 64 Next
Author Message
hannysabbagh

Joined: 14 Apr 2013
Posts: 17

PostPosted: Sun 14 Apr 2013, 08:02    Post subject:  

Hello.

anybody knows how to get out of this? Smile
http://www.murga-linux.com/puppy/viewtopic.php?t=85640

ThankS!
Back to top
View user's profile Send private message 
DocSalvage


Joined: 30 Jun 2012
Posts: 10
Location: Tallahassee, FL, USA

PostPosted: Tue 16 Apr 2013, 01:41    Post subject: Hyperlinks  

I'm working on an awk program that converts Zim pages to GtkDialogs for checklists and such so it needs to have functional hyperlinks.

I've learned that the Pango markup "<span><a>..." formats the hypertext just fine but taking action on the click is the problem. I've made it work by wrapping the GtkDialog <text> widget in its own <hbox> which is, in turn, wrapped in an <hbox > for the entire line of text. Conceptually, the code looks something like...

Code:

<hbox>
  <hbox>
    <text>
      <label>"<span>non-link-text</span>"</label>
    </text>
  </hbox>
  <hbox>
    <text>
      <label>"<span><a href="...">link-text</a></span>"</label>
      <action signal="button-press-event">...</action>
    </text>
  </hbox>
  <hbox>
    <text>
      <label>"<span>non-link-text</span>"</label>
    </text>
  </hbox>
</hbox>


Very much a work in progress, but maybe this will help others trying to use hyperlinks.

_________________
DocSalvage
www.softwarerevisions.net
Back to top
View user's profile Send private message Visit poster's website 
mister_electronico


Joined: 20 Jan 2008
Posts: 653
Location: Asturias_ España

PostPosted: Thu 23 May 2013, 10:12    Post subject: One cuestion.  

Why don't work this program, and how I can get work.

#! /bin/bash
export CHOOSER
export MAIN_DIALOG='
<vbox>
<chooser>
<height>500</height><width>600</width>
<variable>CHOOSER</variable>
</chooser>
<hbox>
<button help></button>
<button ok></button>
</hbox>
</vbox>
'
gtkdialog --program=MAIN_DIALOG
exec mplayer CHOOSER

I was searching everywhere and I can't see how choose one file and open with some application program, like this example or if I want open file by Menubar.

Thanks for any help.
Back to top
View user's profile Send private message Yahoo Messenger 
zigbert


Joined: 29 Mar 2006
Posts: 5697
Location: Valåmoen, Norway

PostPosted: Thu 23 May 2013, 11:43    Post subject:  

Code:
exec mplayer "$CHOOSER"

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
mister_electronico


Joined: 20 Jan 2008
Posts: 653
Location: Asturias_ España

PostPosted: Sat 25 May 2013, 06:42    Post subject: No work.  

Thanks zigbert for answering but don't work.

The problem with the variable CHOOSER inside of GTKDIALOG is local variable, I not know how export variable outside of GTKDIALOG.

The only way I met is :
Code:

#! /bin/bash
export MAIN_DIALOG='
<vbox>
  <chooser>
   <height>500</height><width>600</width>
   <variable>CHOOSER</variable>
  </chooser>
 <hbox>
   <button ok>
      <action>"echo $CHOOSER > /tmp/tmp"</action>
     <action>exit:Exit</action>
   </button>
 </hbox>
</vbox>
'
gtkdialog --program=MAIN_DIALOG
A=$(cat /tmp/tmp)
echo "$A"
exec mplayer $A



But I think is not very elegant.

Anyway Thanks for you reply.
Back to top
View user's profile Send private message Yahoo Messenger 
Geoffrey


Joined: 30 May 2010
Posts: 1358
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Sat 25 May 2013, 07:43    Post subject:  

Making it a function works

Code:
#! /bin/bash
CHOSEN(){
mplayer $CHOOSER
}
export -f  CHOSEN
export MAIN_DIALOG='
<vbox>
  <chooser>
   <height>500</height><width>600</width>
   <variable>CHOOSER</variable>
  </chooser>
 <hbox>
   <button ok>
     <action>CHOSEN</action>
     <action>exit:Exit</action>
   </button>
 </hbox>
</vbox>
'
gtkdialog --program=MAIN_DIALOG

_________________
Carolina: Recent Repository Additions
Create strikethrough text HERE
Back to top
View user's profile Send private message 
mister_electronico


Joined: 20 Jan 2008
Posts: 653
Location: Asturias_ España

PostPosted: Sat 25 May 2013, 10:17    Post subject: Works...  

Amazing Geoffrey! Works.

When call to the variable trough function works.

Have a problem when you try to choose mplayer file in other partition or hard drive.

Thanks for teaching this way
Back to top
View user's profile Send private message Yahoo Messenger 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Sat 25 May 2013, 11:36    Post subject:  

You can also do it this way-
Code:
eval `gtkdialog --program=MAIN_DIALOG`


This runs the gtkdialog program between the backtics and then evaluates (sets the variables for further use)

Cheers,
s
Back to top
View user's profile Send private message 
mister_electronico


Joined: 20 Jan 2008
Posts: 653
Location: Asturias_ España

PostPosted: Sat 25 May 2013, 15:07    Post subject: Thanks seaside  

Thanks seaside... works perfect.

I check it in the first program, and work perfect and I can open one mplayer file well, even if the file is in other partition or other hardrive.

So thanks for teaching this way too.

Good teachers in this Forum.
Back to top
View user's profile Send private message Yahoo Messenger 
jmrichardson

Joined: 29 May 2013
Posts: 3

PostPosted: Wed 29 May 2013, 14:06    Post subject: Multiple defaults in tree
Subject description: Set multiple selection defaults in tree widget
 

Hello,

Does anyone know of a way set multiple defaults in the tree widget? I see a selected-row tag but that only sets a single default. Does anyone know of how to do this? Thanks in advance!

John
Back to top
View user's profile Send private message 
jmrichardson

Joined: 29 May 2013
Posts: 3

PostPosted: Thu 06 Jun 2013, 15:25    Post subject: gtkdialog changing shell variable  

Hello,

I have been trying to figure out how to change a bash variable value within gtkdialog. That is, I load a config file to set my variables within gtkdialog. However, i would like to change the variable value based on user input. When i change the value with an action, it doesn't change the value on exit (it stays the same). I think the action function is kicking off a sub shell, changig the variable there, then returning back to the main shell. If that is correct, any way to change the parent shell variable value without using files for storage?

Thanks,
John
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3261
Location: Ontario

PostPosted: Sat 08 Jun 2013, 16:25    Post subject:  

I'm no expert but if 'export VARIABLE' doesn't work
then I use 'echo $VARIABLE > /path/to/file'

Then I reload in a new function or application.

VARIABLE=`cat /path/to/file`

or

read VARIABLE < /path/to/file

________________________________
Back to top
View user's profile Send private message 
box579

Joined: 29 Jul 2013
Posts: 3

PostPosted: Tue 30 Jul 2013, 00:05    Post subject: list/tree/table with checkbox  

Hey guys,

is there any option to have checkboxes within a gtkdialog tree/list/table? I would like to select multiple items.

Input is optained from a textfile:
monitor1|true|option1
monitor2|false|option2
monitor3|true|option3
Output is written to a textfile.

Thanks & regards,
box579.
Back to top
View user's profile Send private message 
ASRI éducation


Joined: 09 May 2009
Posts: 2417
Location: France

PostPosted: Tue 30 Jul 2013, 11:25    Post subject:  

Hello !
I'm trying to create a GUI (GTK) and I need help.
I use the combobox option and I do not want the user could edit the items offered (so that he can choose only in the list of items proposed by the script).
Currently, my combobox like this:
Code:
<vbox>
<text><label>Live Support</label></text>
<combobox width-request=\""$COMBOBOX_WIDTH"\" tooltip-text=\" Select the live support \">
<variable>CheckLiveSupport</variable>
$LIVE_SUPPORT_ITEMS
</combobox>
</vbox>

My question: is it possible to prevent the publishing of the items proposed by the combobox?

Cordialement,
Back to top
View user's profile Send private message Visit poster's website 
box579

Joined: 29 Jul 2013
Posts: 3

PostPosted: Wed 31 Jul 2013, 05:34    Post subject:  

Hi ASRI education,
to prevent users from editing your items use <comboboxtext> instead of <combobox>. See below, for specs read this:
http://code.google.com/p/gtkdialog/wiki/comboboxtext

Code:
<vbox>
<text><label>Live Support</label></text>
<comboboxtext width-request=\""$COMBOBOX_WIDTH"\" tooltip-text=\" Select the live support \">
<variable>CheckLiveSupport</variable>
$LIVE_SUPPORT_ITEMS
</comboboxtext>
</vbox>


BR, box579.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 52 of 64 [949 Posts]   Goto page: Previous 1, 2, 3, ..., 50, 51, 52, 53, 54, ..., 62, 63, 64 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0929s ][ Queries: 13 (0.0078s) ][ GZIP on ]